<template>
<div>
    <ul >
      <li v-for="(item,index) in arr" :key="index">
        {{item}}----{{index}}
      </li>
    </ul>
  <ul >
    <li v-for="item in arr" >
      {{item}}
    </li>
  </ul>

  <ul >
    <li v-for="(item) in stuArr" :key="item.id">
<!--      遍历对象数组-->
      <span>{{item.name}}  </span>
      <span>{{item.sex}}  </span>
      <span>{{item.hobby}}</span>
    </li>
  </ul>

  <ul >
    <li v-for="(value,key) in tObj" :key="tObj">
      <!--      遍历对象属性-->
      <span>{{value}}  </span>
      <span>{{key}}</span>

    </li>
  </ul>
  <ul >
    <li v-for="n in 10" >
      <!--      遍历数字-->
      <span>{{n}}  </span>

    </li>
  </ul>

</div>
</template>

<script>
export default {

  data() {
    return {
      arr: ["小明", "小欢欢", "大黄"],
      stuArr: [
        {
          id: 1001,
          name: "孙悟空",
          sex: "男",
          hobby: "吃桃子",
        },
        {
          id: 1002,
          name: "猪八戒",
          sex: "男",
          hobby: "背媳妇",
        },
      ],
      tObj: {
        name: "小黑",
        age: 18,
        class: "1期",
      },
      count: 10,
    };
  },
};
</script>

<style scoped>


</style>